package com.mingdao.lhy.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mingdao.lhy.mapper.wish.MiddleSchoolMapper;
import com.mingdao.lhy.mapper.wish.MiddleSchoolWishMapper;
import com.mingdao.lhy.mapper.wish.SignUpStudentMapper;
import com.mingdao.lhy.mapper.wish.ZkwMapper;
import com.mingdao.lhy.mapper.wish.HighSchoolWishMapper;
import com.mingdao.lhy.pojo.HighSchoolWish;
import com.mingdao.lhy.pojo.MiddleSchoolWish;
import com.mingdao.lhy.pojo.SignUpStudent;
import com.mingdao.lhy.pojo.Zkw;

@Service
public class StatEnrolServiceImpl implements StatEnrolService {

	private static Logger log = LoggerFactory.getLogger(StatEnrolServiceImpl.class);

	@Autowired
	private ZkwMapper zkwMapper;

	@Autowired
	private HighSchoolWishMapper highSchoolWishMapper;
	
	@Autowired
	private MiddleSchoolWishMapper middleSchoolWishMapper;

	/**
	 * 根据学校代码返回学校信息
	 */
	@Override
	public Zkw getZkwById(String userid) {
		Zkw zkw = zkwMapper.getOne(userid);
		return zkw;
	}

	@Override
	public int changePassword(Zkw zkw) {
		int result = zkwMapper.updatePasswordByPrimaryKey(zkw);
		return result;
	}

	@Override
	public List<HighSchoolWish> getWishedStudentPage(int pageSize, int pageIndex) {
		Map<String, Integer> map = new HashMap<String, Integer>();
		map.put("pageSize", pageSize);
		map.put("pageIndex", pageIndex);
		List<HighSchoolWish> students = highSchoolWishMapper.getWishedStudentPage(map);
		return students;
	}
	
	@Override
	public HighSchoolWish getOne(String bmh)
	{
		HighSchoolWish students = highSchoolWishMapper.getOne(bmh);
		return students;
	}
	
	@Override
	public List<HighSchoolWish> statEnrolgetOne(String bmh)
	{
		List<HighSchoolWish> students = highSchoolWishMapper.statEnrolgetOne(bmh);
		return students;
	}
	
	@Override
	public List<MiddleSchoolWish> getMidWishedStudentPage(int pageSize, int pageIndex) {
		Map<String, Integer> map = new HashMap<String, Integer>();
		map.put("pageSize", pageSize);
		map.put("pageIndex", pageIndex);
		List<MiddleSchoolWish> students = middleSchoolWishMapper.getMidWishedStudentPage(map);
		return students;
	}
	
	@Override
	public List<MiddleSchoolWish> statEnrolgetMidOne(String bmh) {
		List<MiddleSchoolWish> students = middleSchoolWishMapper.statEnrolgetMidOne(bmh);
		return students;
	}

	
}
